<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>深层响应式</h2>
      <p>obj: {{ obj }}</p>
      <button v-on:click="fn">btn</button>
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      const app = Vue.createApp({
        data() {
          return {
            obj: {
              name: "junlong",
              age: 18,
              likes: ["eat", "sleep", "code"],
            },
          };
        },

        methods: {
          fn() {
            this.obj.age = 20;
            this.obj.sex = 1;
            this.obj.likes = ["eat", "sleep", "code", "music"];
          },
        },
      }).mount("#app");
    </script>
  </body>
</html>
